package com.example.bnuzzu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.bnuzzu.common.dto.HouseListDto;
import com.example.bnuzzu.common.dto.RoommateListDto;
import com.example.bnuzzu.entity.Roommate;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoommateMapper extends BaseMapper<Roommate> {

    @Select("SELECT mates.*,users.UserName FROM roommate as mates,userinfo as users " +
            "WHERE mates.deleted = 0 AND users.UserID = mates.UserID ORDER BY Deleted,Modtime DESC")
    List<RoommateListDto>getAllMate();

    IPage<RoommateListDto>searchPage(Page<?> page,RoommateListDto roommateListDto);
}
